<script setup lang="ts">
import { ref } from 'vue';

const props = defineProps<{
    modelValue: string;
}>();

const emit = defineEmits(['update:modelValue']);

const answer = ref(props.modelValue);

const updateAnswer = (value: string) => {
    answer.value = value;
    emit('update:modelValue', value);
};
</script>

<template>
    <van-field
        v-model="answer"
        type="textarea"
        rows="4"
        placeholder="请输入答案"
        @update:model-value="updateAnswer"
    />
</template>